/*
@filename		:  object.js
@description	:  Object  basic methods
-----------------------------------------------------------------------------
@author	:  ScriptPower     <a href="mailto:scriptpower@qq.com">scriptpower@qq.com</a>
@update	:  2010-12-30
*/
(function (S){
	var keys = Object.keys,
		isObject = S.isObject,
		isFunction = S.isFunction;
	//keys
	function keys(obj){
		var ret = [], x;
		for(x in obj) ret.push(x);
		return ret;
	}

	function isOF(obj){
		return (!!obj && typeof(obj) == "object") || typeof(obj) == "function";
	}

	S.define(S.Object,
		"keys", keys ? function (obj){
			return isObject(obj) || isFunction(obj) ? keys(obj) : [];
		} : function (obj){
			var ret = [], x;
			for(x in obj) ret.push(x);
			return ret;
		});

})(SP)